// 质检
import request from "@/utils/request";


//获取质检列表
export function getQualityList(taskId, query) {
  return request({
    url: `/task/${taskId}/quality/list`,
    method: "get",
    params: query,
  });
}
//新建质检
export function addQuality(taskId, data) {
  return request({
    url: `/task/${taskId}/quality`,
    method: "post",
    data: data,
  });
}

// 编辑质检
export function editQuality(taskId, data) {
  return request({
    url: `/task/${taskId}/quality`,
    method: "put",
    data: data,
  });
}

// 获取质检详情
export function getQualityDetail(taskId, id) {
  return request({
    url: `/task/${taskId}/quality/${id}`,
    method: "get",
  });
}

// 审批
export function approveQuality(taskId, data) {
  return request({
    url: `/task/${taskId}/quality/approve`,
    method: "post",
    data
  });
}


// 质检
export function checkQuality(taskId, data) {
  return request({
    url: `/task/${taskId}/quality/check`,
    method: "post",
    data
  });
}

// 整改
export function reformQuality(taskId, data) {
  return request({
    url: `/task/${taskId}/quality/reform`,
    method: "post",
    data: data,
  });
}

// 分发
export function distributeQuality(taskId, data) {
  return request({
    url: `/task/${taskId}/quality/distribute`,
    method: "post",
    data
  });
}

// 单个删除
export function deleteQuality(taskId, id) {
  return request({
    url: `/task/${taskId}/quality/${id}`,
    method: "delete"
  });
}

// 提交
export function commitQuality(taskId, id) {
  return request({
    url: `/task/${taskId}/quality/${id}/commit`,
    method: "post"
  });
}
